package com.xianggu.designMode.orderMethod;

import com.xianggu.designMode.orderMethod.impl.AirConditioner;
import com.xianggu.designMode.orderMethod.impl.Curtain;
import com.xianggu.designMode.orderMethod.impl.Light;

/**
 * @author chengjy
 * @date 2025/3/15
 */
public class OrderDemo {
    public static void main(String[] args) {
        Light light = new Light();
        AirConditioner ac = new AirConditioner();
        Curtain curtain = new Curtain();
        // 具体命令
        HomeModeCommand homeModeCommand = new HomeModeCommand(light, ac, curtain);

        // 调用命令
        AppController controller = new AppController();
        controller.executeCommand( homeModeCommand);

        System.out.println("---------------------------");

        // 撤销命令
        controller.undoLastCommand();
    }
}
